package mse.eai.esb;

import org.jboss.logging.Logger;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.listeners.ScheduledEventMessageComposer;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.message.format.MessageType;
import org.jboss.soa.esb.schedule.SchedulingException;

public class ScheduledDailyDigestMessageComposer implements
		ScheduledEventMessageComposer {

	private static final Logger log = Logger
			.getLogger(ScheduledDailyDigestMessageComposer.class);

	public void initialize(ConfigTree config) throws ConfigurationException {

	}

	public void uninitialize() {

	}

	public Message composeMessage() throws SchedulingException {

		log.info("Composing Message");
		Message myMessage = MessageFactory.getInstance().getMessage(
				MessageType.DEFAULT_TYPE);

		return myMessage;
	}

	public Message onProcessingComplete(Message message)
			throws SchedulingException {
		log.info("onProcessingComplete");
		log.info("<------- ESB Action done");
		return message;
	}
}
